package com.zxy.ziems.server.message;

public class MessageConstants {

    public enum WebSocketType {
        ALARM_RECORD("alarmRecord", "告警消息"),
        PING("ping", "心跳消息"),
        ;

        private String type;
        private String desc;

        private WebSocketType(String type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public static WebSocketType getByType(String type) {
            for (WebSocketType webSocketType : WebSocketType.values()) {
                if (webSocketType.getType().equals(type)) {
                    return webSocketType;
                }
            }
            return null;
        }

        public String getType() {
            return type;
        }
        public String getDesc() {
            return desc;
        }
    }
}
